<?php
include_once ("includes/connect.php");
include_once ("includes/function.php");

$pet_id = $_REQUEST["pet_id"];

$task = $_REQUEST["task"];

$cheque_no = $_REQUEST["cheque_no"];
?>

<script type="text/javascript">
    $(document).ready(function() {
        $("#i_date").datepicker({
            dateFormat: "yy-mm-dd",
            showButtonPanel: true
        });

        $("#save_menus").click(function() {
            event.preventDefault();

            var i_date = $("#i_date").val();
            var task = "<?php echo $task; ?>";
            var pet_id = "<?php echo $pet_id; ?>";
            var cheque_no = "<?php echo $cheque_no; ?>";

            $.post('process_status_welfare.php', {task: task, pet_id: pet_id, i_date: i_date, cheque_no: cheque_no}, function(data) {

                if (task == "approvedCheque") {
                    window.location.href = "index.php?pages=paid_welfare";
                } else if (task == "approved") {
                    //alert(data);
                    window.location.href = "index.php?pages=verify_approved_welfare";
                }
            });
        });
    });
</script>

<p>
    <label>วันที่</label>
    <input class="span3" type="text" id="i_date" name="i_date" />


</p>
<div class="form-actions">
    <button class="btn btn-primary" id="save_menus">บันทึก</button>
    <a class="btn close-dialog"><i class="icon-remove"></i> ยกเลิก</a>

</div>
